Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #18334: handle path with spaces on windows during bootstrap #18337

Conversation

timotheecour
Copy link
Member

@timotheecour timotheecour commented Jun 23, 2021

@timotheecour timotheecour marked this pull request as ready for review June 24, 2021 00:26
@timotheecour timotheecour added the Ready For Review (please take another look): ready for next review round label Jun 24, 2021
compiler/nim.nim Outdated
const dir = when defined(nimKochBootstrap):
# remove workaround pending bootstrap >= 1.5.1
# refs https://github.com/nim-lang/Nim/issues/18334#issuecomment-867114536
currentSourcePath.parentDir.quoteShell & "\\"
Copy link
Member

@Araq Araq Jun 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quoting (quoteShell) only a part of the path is bad style. Why not simply:

when defined(amd64) and defined(windows) and defined(vcc) and not defined(nimKochBootstrap):
  {.link: "../icons/nim-amd64-windows-vcc.res".}
when defined(i386) and defined(windows) and defined(vcc) and not defined(nimKochBootstrap):
  {.link: "../icons/nim-i386-windows-vcc.res".}

Copy link
Member Author

@timotheecour timotheecour Jun 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done;
but i had done it that way to preserve semantics (would be needed anyways if those files were not optional); in future if there's a situation where those are not optional, smthg like this should work:

template link2(a) =
  const a2 =
    when defined(nimKochBootstrap):
      quoteShell(currentSourcePath.parentDir / a)
    else: a
  {.link: a2.}

then use link2 in such places

@timotheecour timotheecour force-pushed the pr_fix_18334_workaround_bootstrap_spaces branch from 4a114cf to 49ac7e7 Compare June 24, 2021 06:58
@Araq Araq added merge_when_passes_CI mergeable once green and removed Ready For Review (please take another look): ready for next review round labels Jun 24, 2021
@timotheecour timotheecour merged commit 55c1953 into nim-lang:devel Jun 24, 2021
@timotheecour timotheecour deleted the pr_fix_18334_workaround_bootstrap_spaces branch June 24, 2021 07:58
PMunch pushed a commit to PMunch/Nim that referenced this pull request Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge_when_passes_CI mergeable once green
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compiler can't handle nimble pkg file paths with spaces (Windows).
2 participants